Update the magnetic energy when enforcing consistency in the interface magnetic field#457
Conversation
hfhsieh
left a comment
There was a problem hiding this comment.
@ChunYen-Chen @hyschive
Before looking into the details, I would like to ask something:
- Since it's only during initialization that we do not need to update the magnetic energy in
MHD_SameInterfaceB(), I think we can always perform the update, as it should not impact performance. - Should we update the wiki documentation to note this behavior under
MINMOD_MAX_ITER, or consider automatically enablingOPT__SAME_INTERFACE_BwhenMINMOD_MAX_ITER > 0in MHD simulations?
Agreed. I’ll let you know once I’ve updated the code.
I will update the wiki document. |
Agree. How about declaring You can also define a corresponding Also, remember to raise a warning message in |
ad5338b to
aa83e3b
Compare
|
@hfhsieh I’ve updated the PR. Please take a look when you have time—thank you in advance! |
hfhsieh
left a comment
There was a problem hiding this comment.
Looks good to me. I have added some comments.
|
@hfhsieh Thanks for the review. I have addressed the comments. |
|
@ChunYen-Chen Could you resolve the conflicts caused by the recent wiki updates? Thanks. |
hyschive
left a comment
There was a problem hiding this comment.
@ChunYen-Chen Thanks for the contribution! Please let me know if you agree with the comments I've added. Also, I've filed a potentially related issue (#513).
Conflicts: doc/wiki/Runtime-Parameters-related/[Runtime-Parameters]-All.md
Co-authored-by: Hsi-Yu Schive <hyschive@gmail.com>
|
@ChunYen-Chen Is it ready for another review? |
|
@hyschive There is one last comment that needs to be resolved. I will let you know once I have finished. |
|
@hyschive Thanks for the review. The PR has been updated and is ready for the next round of review. |
Currently, if
MINMOD_MAX_ITERis enabled to reduce the minmod coefficient in each patch, the output of the magnetic field may become inconsistent due to variations in the minmod coefficient across nearby patches.To address this issue, enabling
OPT__SAME_INTERFACE_Benforces consistency of the magnetic field at patch interfaces. However, in the current implementation, the magnetic energy at the interface is not updated.This PR ensures that magnetic energy is updated when
OPT__SAME_INTERFACE_Bis enabled.